package com.szp.lg.blog.pojo;


import javax.persistence.*;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "t_article")
public class Blog {
    //    CREATE TABLE t_article (
//            id int(11) NOT NULL AUTO_INCREMENT,
//    title varchar(50) NOT NULL COMMENT '文章标题',
//    content longtext COMMENT '文章具体内容',
//    created date NOT NULL COMMENT '发表时间',
//    modified date DEFAULT NULL COMMENT '修改时间',
//    categories varchar(200) DEFAULT '默认分类' COMMENT '文章分类',
//    tags varchar(200) DEFAULT NULL COMMENT '文章标签',
//    allow_comment tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否允许评论',
//    thumbnail varchar(200) DEFAULT NULL COMMENT '文章缩略图',
//    PRIMARY KEY (id)
    @Id
    Long id;
    String title;
    String content;
    Date created;
    Date modified;
    String categories;
    String tags;
    @Column(name = "allow_comment")
    boolean allowComment;
    String thumbnail;

    @Override
    public String toString() {
        return "Blog{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", created=" + created +
                ", modified=" + modified +
                ", categories='" + categories + '\'' +
                ", tags='" + tags + '\'' +
                ", allowComment=" + allowComment +
                ", thumbnail='" + thumbnail + '\'' +
                '}';
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getModified() {
        return modified;
    }

    public void setModified(Date modified) {
        this.modified = modified;
    }

    public String getCategories() {
        return categories;
    }

    public void setCategories(String categories) {
        this.categories = categories;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public boolean isAllowComment() {
        return allowComment;
    }

    public void setAllowComment(boolean allowComment) {
        this.allowComment = allowComment;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

}
